<?php

/**************************************************/
class OnlinePaymentsFilter {
/**************************************************/
    const FLT_FROM = "f1";
    const FLT_UNTIL = "f2";
    const FLT_PARTNER = "f3";
    const FLT_INVOICENUMBER = "f4";
    const FLT_TRANSACTIONRESULT = "f5";

    private $from = null;
    private $until = null;
    private $partner = null;
    private $invoiceNumber = null;
    private $transactionResult = null;
    
    function __construct($filterData) {
        foreach ($filterData as $key=>$value) {
            if ($key == FLT_FROM) { $from = $value; }
            else if ($key == FLT_UNTIL) { $until = $value; }
            else if ($key == FLT_PARTNER) { $partner = $value; }
            else if ($key == FLT_INVOICENUMBER) { $invoiceNumber = $value; }
            else if ($key == FLT_TRANSACTIONRESULT) { $transactionResult = $value; }
        }
    }
    
    function get() {
        $result = array();
        if ($this->from) { $result['from'] = $from; }
        if ($this->until) { $result['until'] = $until; }
        if ($this->partner) { $result['partner'] = $partner; }
        if ($this->invoiceNumber) { $result['invoice-number'] = $invoiceNumber; }
        if ($this->transactionResult) { $result['transaction-result'] = $transactionResult; }
        return $result;
    }
}


?>
